﻿using System;
using System.Collections.Generic;

public class SelectTargetMgr
{

    public SceneFightObject selectObj { get; private set; }
    //设置当前选中
    public void SetSelectTarget(SceneFightObject target)
    {
        if (target == null)
            return;
        if (!target.isCanChoose())
            return;

        selectObj = target;

        SelectPanelExt panel = Mgr.panelMgr.ShowPanel(EnumPanelType.SelectPanel) as SelectPanelExt;
        panel.SetFightObj(target);
    }

    public void ResetSelect(SceneFightObject target)
    {
        if (target != selectObj)
            SetSelectTarget(target);
    }

    public void ClearSelect()
    {
        selectObj = null;
        Mgr.panelMgr.HidePanel(EnumPanelType.SelectPanel);
    }


    //==============================================
    private static SelectTargetMgr instance;

    public static SelectTargetMgr Instance
    {
        get
        {
            if (instance == null)
                instance = new SelectTargetMgr();
            return instance;
        }
    }
}
